package day_2022_4_to_7.day48;

import java.util.Scanner;

/**
 * 年会抽奖
 * @author haomin
 * @date 2022/06/03 08:55
 **/
public class Day35_1_MeetingLottery {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()){
            int n = in.nextInt();
            double num1 = count(n);
            double num2 = factorial(n);
            double result = (num1/num2) * 100;
            System.out.println(String.format("%.2f",result) + "%");
        }
    }

    // 错排算法
    private static double count(int n) {
        if(n == 1){
            return 0;
        }else
        if(n == 2){
            return 1;
        }else
        return (n-1) * (count(n-1) + count(n-2));
    }

    // 阶乘
    private static double factorial(int n) {
        if(n == 0 || n == 1){
            return 1;
        }
        return n * factorial(n-1);
    }
}